# -*- coding: utf-8 -*-

def ils_insert_admin_groups(db):
    db.auth_group.insert(
        role='Head Librarian', description='The Head Librarian',
    )
    db.auth_group.insert(
        role='Librarian', description='LASFS Librarian',
    )
    db.auth_group.insert(
        role='Member', description='LASFS Member',
    )
    db.auth_group.insert(
        role='Guest', description='LASFS Guest',
    )

	
ILS_ITEM_TYPES = [
    ["Art", ""],
    ["Audio CD", ""],
    ["Binder", ""],
    ["CD", ""],
    ["Cassette", ""],
    ["Children's", ""],
    ["Computer", ""],
    ["DVD", ""],
    ["Graphics", ""],
    ["Hardback", ""],
    ["Magazine", ""],
    ["Media", ""],
    ["Oversize", ""],
    ["Paperback", ""],
    ["Portfolio", ""],
    ["Reference", ""],
    ["Tradepaper", ""]
]

def ils_insert_ils_item_types(db):
    for type in ILS_ITEM_TYPES:
        db.ils_item_type.insert(name=type[0], description=type[1])
	
ILS_ITEM_LOCATIONS = [
    ["Anthology", ""],
    ["Art", ""],
    ["Audio", ""],
    ["Children's", ""],
    ["Fiction", ""],
    ["Graphics", ""],
    ["Manga", ""],
    ["Media", ""],
    ["Nonfiction", ""],
    ["Omnibus", ""],
    ["Oversize", ""],
    ["Poetry", ""],
    ["Reference", ""],
    ["Series", ""],
    ["OFFSITE", ""],
    ["OFFSITE #2", ""],
    ["OFFSITE #3", ""],
    ["OFFSITE #4", ""],
    ["OFFSITE #5", ""],
    ["OFFSITE #6", ""],
    ["OFFSITE #7", ""],
    ["OFFSITE #8", ""],
    ["OFFSITE #9", ""],
    ["OFFSITE #23", ""],
    ["OFFSITE #49", ""],
    ["OFFSITE #50", ""],
    ["OFFSITE #51", ""],
    ["OFFSITE #52", ""],
    ["OFFSITE #53", ""],
    ["OFFSITE #54", ""],
    ["OFFSITE #55", ""],
    ["OFFSITE #56", ""],
    ["OFFSITE #57", ""],
    ["OFFSITE #58", ""],
    ["OFFSITE #59", ""],
    ["OFFSITE #60", ""],
    ["OFFSITE #61", ""],
    ["OFFSITE #62", ""],
    ["OFFSITE #63", ""],
    ["OFFSITE #64", ""],
    ["OFFSITE #66", ""],
    ["OFFSITE #67", ""],
    ["OFFSITE #73", ""],
    ["OFFSITE #74", ""],
    ["OFFSITE #75", ""],
    ["OFFSITE #76", ""],
    ["OFFSITE #78", ""],
    ["OFFSITE #79", ""],
    ["OFFSITE #80", ""],
    ["OFFSITE #81", ""],
    ["OFFSITE #82", ""],
    ["OFFSITE #83", ""],
    ["OFFSITE #84", ""],
    ["OFFSITE #85", ""],
    ["OFFSITE #86", ""]
]

def ils_insert_ils_item_locations(db):
    for type in ILS_ITEM_LOCATIONS:
        db.ils_item_location.insert(name=type[0], description=type[1])


ILS_ITEM_STATES = [
    ["AVAILABLE", ""],
    ["CHECKEDOUT", ""],
    ["RESERVED", ""],
    ["LOST", ""],
]


def ils_insert_ils_item_states(db):
    for type in ILS_ITEM_STATES:
        db.ils_item_state.insert(name=type[0], description=type[1])


ILS_ITEM_EVENT_TYPES = [
    ["ADDED", ""],
    ["CHECKOUT", ""],
    ["CHECKIN", ""],
    ["UPDATED", ""],
]

def ils_insert_ils_item_event_types(db):
    for type in ILS_ITEM_EVENT_TYPES:
        db.ils_item_event_type.insert(name=type[0], description=type[1])


ILS_PERSON_TYPES = [
    ["Author", ""],
    ["Co-Author", ""],
    ["Editor", ""],
]

def ils_insert_ils_person_types(db):
    for type in ILS_PERSON_TYPES:
        db.ils_person_type.insert(name=type[0], description=type[1])

